import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  // mode: 'history',
  routes: [
    {
      path: '/',
      name: 'Index',
      component: resolve => require(['../components/Layout'], resolve),
      children: [
        {
          path: '',
          component: resolve => require(['../views/mall/Index'], resolve),
          children:[
            {path:'',component:resolve =>require(['../views/mall/popular'],resolve)},
            {path:'family',component:resolve =>require(['../views/mall/family'],resolve)},
            {path:'andrology',component:resolve =>require(['../views/mall/andrology'],resolve)},
            {path:'gynaecology',component:resolve =>require(['../views/mall/gynaecology'],resolve)},
            {path:'pediatrics',component:resolve =>require(['../views/mall/pediatrics'],resolve)},
            {path:'specialty',component:resolve =>require(['../views/mall/specialty'],resolve)},
          ]
        },
        {
          path: 'product',
          component: resolve => require(['../views/mall/ProductDetail'], resolve)
        },
        {
          path: 'shopping-cart',
          component: resolve => require(['../views/mall/ShoppingCart'], resolve)
        },
        {
          path: 'orders',
          component: resolve => require(['../views/mall/Orders'], resolve)
        }
      ]
    },
    {
      path: '/info',
      name: 'Info',
      component: resolve => require(['../components/Layout'], resolve),
      children: [{
        path: '',
        component: resolve => require(['../views/info/Index'], resolve),
        children:[
            {path:'',component:resolve =>require(['../views/info/health'],resolve)},
            {path:'/reduces',component:resolve =>require(['../views/info/reduces'],resolve)},
            {path:'/cosmetology',component:resolve =>require(['../views/info/cosmetology'],resolve)},
            {path:'/mother',component:resolve =>require(['../views/info/mother'],resolve)},
            {path:'/chronic',component:resolve =>require(['../views/info/chronic'],resolve)},
        ]
      },
      {
        path: 'detail',
        component: resolve => require(['../views/info/ProductDetail'], resolve)
      }
      ]
    },
    {
      path: '/about',
      name: 'About',
      component: resolve => require(['../components/Layout'], resolve),
      children: [{
        path: '',
        component: resolve => require(['../views/about/about'], resolve)
      }
      ]
    },
    {
      path: '/register',
      name: 'Register',
      component: resolve => require(['../views/Register'], resolve)
    },
    {
      path: '/reset-password',
      name: 'ResetPassword',
      component: resolve => require(['../views/ResetPassword'], resolve)
    },
    // {
    //   path: '/yygh',
    //   component: resolve => require(['../components/Layout'], resolve),
    //   children: [
    //     {
    //       path: '/',
    //       component: resolve => require(['../views/yygh/Index'], resolve)
    //     },
    //     {
    //       path: 'doctor',
    //       component: resolve => require(['../views/yygh/Doctor'], resolve)
    //     },
    //     {
    //       path: 'doctordetail',
    //       component: resolve => require(['../views/yygh/DoctorDetail'], resolve)
    //     },
    //     {
    //       path: 'confirm',
    //       component: resolve => require(['../views/yygh/Confirm'], resolve)
    //     },
    //     {
    //       path: 'searchResult',
    //       component: resolve => require(['../views/yygh/SearchResult'], resolve)
    //     },
    //     {
    //       path: 'pay',
    //       component: resolve => require(['../views/yygh/Pay'], resolve)
    //     },
    //     {
    //       path: 'cancel-order',
    //       component: resolve => require(['../views/yygh/CancelOrder'], resolve)
    //     },
    //     {
    //       path: 'payresult',
    //       component: resolve => require(['../views/yygh/PayResult'], resolve)
    //     },
    //     {
    //       path: 'transfer',
    //       component: resolve => require(['../views/yygh/Transfer'], resolve)
    //     }
    //   ]
    // },
    // {
    //   path: '/personal',
    //   component: resolve => require(['../components/Layout'], resolve),
    //   children: [
    //     {
    //       path: '/',
    //       component: resolve => require(['../views/personal/Index'], resolve)
    //     },
    //     {
    //       path: 'history',
    //       component: resolve => require(['../views/personal/History'], resolve)
    //     },
    //     {
    //       path: 'family',
    //       component: resolve => require(['../views/personal/Family'], resolve)
    //     },
    //     {
    //       path: 'myexpress',
    //       component: resolve => require(['../views/personal/Myexpress'], resolve)
    //     },
    //     {
    //       path: 'modify-password',
    //       component: resolve => require(['../views/personal/ModifyPassword'], resolve)
    //     }
    //   ]
    // },
    // {
    //   path: '/report',
    //   component: resolve => require(['../components/Layout'], resolve),
    //   children: [
    //     {
    //       path: '/',
    //       component: resolve => require(['../views/report/Index'], resolve)
    //     },
    //     {
    //       path: 'detail',
    //       component: resolve => require(['../views/report/Detail'], resolve)
    //     }
    //   ]
    // },
    {
      path: '*',
      component: resolve => require(['../components/NotFound'], resolve)
    },
    // {
    //   path: '/cloud',
    //   component: resolve => require(['../components/Layout'], resolve),
    //   children: [
    //     {
    //       path: '/',
    //       component: resolve => require(['../views/cloud/index'], resolve)
    //     },
    //     {
    //       path: 'confirm',
    //       component: resolve => require(['../views/cloud/confirm'], resolve)
    //     },
    //     {
    //       path: 'pay',
    //       component: resolve => require(['../views/cloud/pay'], resolve)
    //     },
    //     {
    //       path: 'cancelorder',
    //       component: resolve => require(['../views/cloud/cancelorder'], resolve)
    //     },
    //     {
    //       path: 'payresult',
    //       component: resolve => require(['../views/cloud/payresult'], resolve)
    //     },
    //     {
    //       path: 'appoint_history',
    //       component: resolve => require(['../views/cloud/appoint_history'], resolve)
    //     },
    //     {
    //       path: 'meeting',
    //       component: resolve => require(['../views/cloud/meeting'], resolve)
    //     },
    //     {
    //       path: 'my_file',
    //       component: resolve => require(['../views/cloud/my_file'], resolve)
    //     },
    //     {
    //       path: 'paper',
    //       component: resolve => require(['../views/cloud/paper'], resolve)
    //     },
    //     {
    //       path: 'filetest',
    //       component: resolve => require(['../views/cloud/filetest'], resolve)
    //     }
    //   ]
    // },
    // {
    //   path: '/doctor',
    //   component: resolve => require(['../components/Layout'], resolve),
    //   children: [
    //     {
    //       path: '/',
    //       component: resolve => require(['../views/doctor/index'], resolve)
    //     },
    //     {
    //       path: 'cloud_meeting',
    //       component: resolve => require(['../views/doctor/cloud_meeting'], resolve)
    //     },
    //     {
    //       path: 'todo_list',
    //       component: resolve => require(['../views/doctor/todo_list'], resolve)
    //     },
    //     {
    //       path: 'done_list',
    //       component: resolve => require(['../views/doctor/done_list'], resolve)
    //     },
    //     {
    //       path: 'todo_detail',
    //       component: resolve => require(['../views/doctor/todo_detail'], resolve)
    //     }
    //   ]
    // },
    // {
    //   path: '/cloud_mail',
    //   component: resolve => require(['../components/Layout'], resolve),
    //   children: [
    //     {
    //       path: '/',
    //       component: resolve => require(['../views/cloud_mail/index'], resolve)
    //     },
    //     {
    //       path: 'pay_method',
    //       component: resolve => require(['../views/cloud_mail/pay_method'], resolve)
    //     },
    //     {
    //       path: 'pay_result',
    //       component: resolve => require(['../views/cloud_mail/pay_result'], resolve)
    //     },
    //     {
    //       path: 'sel_mail',
    //       component: resolve => require(['../views/cloud_mail/sel_mail'], resolve)
    //     },
    //     {
    //       path: 'process',
    //       component: resolve => require(['../views/cloud_mail/process'], resolve)
    //     },
    //     {
    //       path: 'mailQrcode',
    //       component: resolve => require(['../views/cloud_mail/pay_mail_code'], resolve)
    //     }
    //   ]
    // },
    {
      path: '/mall',
      component: resolve => require(['../components/Layout'], resolve),
      children: [
        {
          path: '/',
          component: resolve => require(['../views/mall/Index'], resolve),
          children:[
            {path:'',component:resolve =>require(['../views/mall/popular'],resolve)},
            {path:'family',component:resolve =>require(['../views/mall/family'],resolve)},
          ]
        },
        {
          path: 'product',
          component: resolve => require(['../views/mall/ProductDetail'], resolve)
        },
        {
          path: 'shopping-cart',
          component: resolve => require(['../views/mall/ShoppingCart'], resolve)
        },
        {
          path: 'orders',
          component: resolve => require(['../views/mall/Orders'], resolve)
        }
      ]
    },
    {
      path: '/classroom',
      component: resolve => require(['../components/Layout'], resolve),
      children: [
        {
          path: '/',
          component: resolve => require(['../views/classroom/Index'], resolve)
        },
        {
          path: ':id',
          component: resolve => require(['../views/classroom/VideoDetail'], resolve)
        }
      ]
    },
    {
      path: '/qrcode',
      component: resolve => require(['../components/qrcode'], resolve)
    }
  ]
})
